import { createRouter, createWebHashHistory } from 'vue-router';
// eslint-disable-next-line no-duplicate-imports
import type { Router, RouteRecordRaw } from 'vue-router';
import routes from './routes';
import { useRouterGuard } from './router-guard';
const router: Router = createRouter({
  history: createWebHashHistory(),
  scrollBehavior: () => ({ top: 0 }),
  routes: routes as RouteRecordRaw[]
});

// 路由守卫
useRouterGuard(router);

export default router;
